package edu.uc.labs.MobilePrinting.PrintUtils;

/**
 * 
 * @author Matt Silbernagel
 */
public class Printer {

	private String queue;
	private String server;
	private String name;
	private String ppd;
	private String zone;
	private String location;
	private boolean active = false;
	private boolean empty = true;

	// constructor for printer class
	public Printer() {

	}

	// Override Constructor to accept arguments
	public Printer(String pName, String pQueue, String pServer, String pPPD,
			String pLocation) {
		this.name = pName;
		this.queue = pQueue;
		this.server = pServer;
		this.ppd = pPPD;
		this.location = pLocation;
		this.empty = false;
	}

	// Install the printer
	public boolean InstallPrinter() {
		PrinterInstaller printInstall = new PrinterInstaller(this);
		boolean isInstalled = printInstall.install();
		return isInstalled;
	}

	/**
	 * @return the queue
	 */
	public String getQueue() {
		return queue;
	}

	/**
	 * @param queue
	 *            the queue to set
	 */
	public void setQueue(String queue) {
		this.empty = false;
		this.queue = queue;
	}

	/**
	 * @return the server
	 */
	public String getServer() {
		return server;
	}

	/**
	 * @param server
	 *            the server to set
	 */
	public void setServer(String server) {
		this.empty = false;
		this.server = server;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.empty = false;
		this.name = name;
	}

	public void setPPD(String ppd) {
		this.empty = false;
		this.ppd = ppd;
	}

	public String getPPD() {
		return this.ppd;
	}

	public void setZone(String zone) {
		this.empty = false;
		this.zone = zone;
	}

	public String getZone() {
		return this.zone;
	}

	public void setLocation(String loc) {
		this.empty = false;
		this.location = loc;
	}

	public String getLocation() {
		return this.location;
	}

	public String format() {
		return "Name: " + this.name + "\nQueue: " + this.queue + "\nServer: "
				+ this.server + "\n\n";
	}

	public void setActive(boolean a) {
		active = a;
	}

	public boolean isActive() {
		return active;
	}

	public boolean isEmpty() {
		return empty;
	}
}
